package com.cqw.auth.service.impl;

import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.cqw.auth.dao.UserDao;
import com.cqw.auth.domain.MyUser;
import com.cqw.auth.entry.User;
import com.cqw.auth.service.UserService;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.security.core.userdetails.UserDetails;
import org.springframework.security.core.userdetails.UserDetailsService;
import org.springframework.security.core.userdetails.UsernameNotFoundException;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;

/**
 * @author 11700 on 2020/12/30.
 */
@Service("userService")
public class UserServiceImpl extends ServiceImpl<UserDao, User> implements UserService, UserDetailsService {


	@Resource
	private UserDao userDao;

    @Override
    public UserDetails loadUserByUsername(String s) throws UsernameNotFoundException {
        MyUser user = userDao.selectByUserName(s);
        return user;
    }
}